package com.py.pythink.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.py.pythink.bo.SellerQueryBo;
import com.py.pythink.bo.SellersBo;
import com.py.pythink.entity.Sellers;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SellersDao extends BaseMapper<Sellers> {

    @Select("select community ,area,univalence,address,info from t_sellers where address like concat('%',#{address},'%')")
    List<SellersBo> selectByAddress(String address);

    @Select("select community ,area,univalence,address,info from t_sellers where city like concat('%',#{city},'%')")
    List<SellersBo> selectByCity(String city);

    @Select("select community ,area,univalence,address,info from t_sellers where price between #{min} and #{max}")
    List<SellersBo> selectByPrice(int min,int max);

    @Select("select community ,area,univalence,address,info from t_sellers where univalence between #{min} and #{max}")
    List<SellersBo> selectByUnivalence(int min,int max);

    @Select("select community ,area,univalence,address,info from t_sellers where housetype = #{housetype}")
    List<SellersBo> selectByHousetype(int housetype);

    @Select("select community ,area,univalence,address,info from t_sellers order by univalence ")
    List<SellersBo> selectByUnivalence1 ();

    @Select("select community ,area,univalence,address,info from t_sellers order by univalence desc")
    List<SellersBo> selectByUnivalence2 ();

    @Select("select community ,area,univalence,address,info from t_sellers order by ftime ")
    List<SellersBo> selectByOpentime1 ();

    @Select("select community ,area,univalence,address,info from t_sellers order by ftime desc")
    List<SellersBo> selectByOpentime2 ();



    List<SellersBo> selectByMore( SellerQueryBo bo);


}
